<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>server1</title>
	</head>
	<body>
		<h1>这是一号服务器，端口3000</h1>
        <button id="fetchBtn3000">api: set-cookieSelf to 3000</button>

        <img src="http://192.168.0.100:8080/lion.jpg" alt="">
	</body>
	<script type="text/javascript">
		(() => {
			// 获取按钮
			const fetchBtn = document.getElementById('fetchBtn3000');

			// 点击按钮发起请求
			fetchBtn.addEventListener('click', () => {
				fetch('https://www.server1.com:3000/set-cookieself', {
					method: 'GET',
					credentials: 'include',
					cache: 'no-cache',
				})
					.then((res) => res.text())
					.then((res) => {
						console.log(res);
					});
			});
		})();
	</script>
</html>
